<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2021/11/17
  Time: 9:42
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <meta charset="UTF-8">
    <title>天天生鲜－商品列表</title>
    <link rel="stylesheet" type="text/css" href="static/css/reset.css">
    <link rel="stylesheet" type="text/css" href="static/css/main.css">
    <script type="text/javascript" src="static/js/jquery-1.12.4.min.js.下载"></script>
</head>
<body>
<!--头部开始-->
<div class="header_con">
    <div class="header">
        <div class="welcome fl">欢迎来到天天生鲜!</div>
        <div class="login_btn fl"><a href="http://www.softeem.com/web1/index.php" style="margin-left:30px" target="_blank">软帝项目</a></div>
        <div class="fr">
            <div class="login_info fl">Tom
                欢迎您：<em>""</em>
                <a href="login.html" class="zhuxiao">注销</a>
            </div>
            <div class="login_btn fl">
                <a href="login.html">登录</a>
                <span>|</span>
                <a href="register.html">注册</a>
            </div>

            <div class="user_link fl">
                <span>|</span>
                <a href="customer.html">用户中心</a>
                <span>|</span>
                <a href="shop.html">我的购物车</a>
                <span>|</span>
                <a href="order.html">我的订单</a>
            </div>
        </div>
    </div>
</div>
<!--头部结束-->

<div class="search_bar clearfix">
    <a href="/selectAll_Goods" class="logo fl"><img src="static/images/logo.png"></a>
    <div class="search_con fl">
        <form method="get" action="" target="_blank">
            <input type="text" class="input_text fl" name="q" placeholder="搜索商品">
            <input type="submit" class="input_btn fr" value="搜索">
        </form>
    </div>
    <div class="guest_cart fr">
        <a href="shop.html" class="cart_name fl">我的购物车</a>
        <div class="goods_count fl" id="show_count">3</div>
    </div>
</div>

<div class="navbar_con">
    <div class="navbar clearfix">
        <div class="subnav_con fl">
            <h1>全部商品分类</h1>
            <span></span>
            <ul class="subnav">
                <li><a href="#" class="fruit">新鲜水果</a></li>
                <li><a href="#" class="seafood">海鲜水产</a></li>
                <li><a href="#" class="meet">猪牛羊肉</a></li>
                <li><a href="#" class="egg">禽类蛋品</a></li>
                <li><a href="#" class="vegetables">新鲜蔬菜</a></li>
                <li><a href="#" class="ice">速冻食品</a></li>
            </ul>
        </div>
        <ul class="navlist fl">
            <li><a href="/selectAll_Goods">首页</a></li>
            <li class="interval">|</li>
            <li><a href="#">手机生鲜</a></li>
            <li class="interval">|</li>
            <li><a href="#">抽奖</a></li>
        </ul>
    </div>
</div>

<div class="breadcrumb">
    <a href="/selectAll_Goods">全部分类</a>
    <span>&gt;</span>
    <span>搜索结果</span>
</div>

<div class="main_wrap clearfix">
    <div class="l_wrap fl clearfix">
        <div class="new_goods">
            <h3>热销推荐</h3>
            <ul>
                <ul>
                    <c:forEach items="${goods_Num}" var="g">
                        <li>
                            <a href="/goodsInfo?gid=${g.gid}"><img src="static/images/所有商品/${g.picture}"></a>
                            <h4><a href="/goodsInfo?gid=${g.gid}">${g.title}</a></h4>
                            <div class="prize">￥${g.price}</div>
                        </li>
                    </c:forEach>
                </ul>
            </ul>
        </div>
    </div>

    <div class="r_wrap fr clearfix">
        <div class="sort_bar">

            <a href="#" class="active">默认</a>
            <%--            <a href="/readmoreShop?type=${type}">价格</a>--%>
            <%--            <a href="#">销量</a>--%>

        </div>

        <ul class="goods_type_list clearfix">
            <c:forEach items="${goods_Like.list}" var="g">
                <li>
                    <a href="/goodsInfo?gid=${g.gid}"><img src="static/images/所有商品/${g.picture}"></a>
                    <h4><a href="/goodsInfo?gid=${g.gid}">${g.title}</a></h4>
                    <div class="operate">
                        <span class="prize">¥${g.price}</span>
                        <span class="unit">${g.price}${g.weight}/kg</span>
                        <a href="javascript:;" class="add_goods" title="加入购物车"></a>
                        <span id="spanid" style="display: none">45</span>
                    </div>
                </li>
            </c:forEach>
        </ul>
        <div class="pagenation">
            <c:if test="${goods_Like.hasPreviousPage }">
                <a href="/selectLikeAll?title=${title}&pageNum=${goods_Like.pageNum-1}" ><span aria-hidden="true">上页</span></a>
            </c:if>
            <c:forEach items="${goods_Like.navigatepageNums }" var="page">
                <c:if test="${page==goods_Like.pageNum }">
                    <a style="color: #00bc6f" href="/selectLikeAll?title=${title}&pageNum=${page}">${page}</a>&nbsp;&nbsp;
                </c:if>
                <c:if test="${page!=goods_Like.pageNum }">
                    <a href="${pageContext.request.contextPath}/selectLikeAll?title=${title}&pageNum=${page}">${page}</a>&nbsp;&nbsp;
                </c:if>
            </c:forEach>
            <c:if test="${goods_Like.hasNextPage }">
                <a href="${pageContext.request.contextPath}/selectLikeAll?title=${title}&pageNum=${goods_Like.pageNum+1 }" >
                    <span aria-hidden="true">下页</span></a>
            </c:if>
        </div>
        <div style="clear: both">
            当前${goods_Like.pageNum }页，总共${goods_Like.pages }页，总共${goods_Like.total }条记录
        </div>
    </div>
</div>

<!--底部 开始-->
<div class="footer login_footer">
    <div class="links">
        <a href="">关于软帝</a>
        <span>|</span>
        <a href="">热门培训</a>
        <span>|</span>
        <a href="">联系我们</a>
        <span>|</span>
        <a href="">在线报名</a>
    </div>
    <p>CopyRight © 2019 武汉软帝信息科技有限责任公司</p>
</div>
<!--底部 结束-->

<script>
    $(".add_goods").click(function () {

        $.get("/cart/updatecart/add/1/"+$(this).next().html()+"/1",function (data) {
            if (data.data != 0){
                $("#show_count").html(data.data);
            }
        });
    });
</script>
</body>
</html>
